/**
 * 
 */
package io.dora.conf;

import io.dora.base.Protocol;
import io.dora.protocol.DoraProtocol;

import org.apache.commons.lang.StringUtils;



/**
 * Protocol Config bean
 * 
 * @author zhaohongbo
 *
 */
public class ProtocolConfig extends AbstractServiceConfig {
	
	private String name;
	
	private int port;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	@Override
	public Protocol getProtocol() {
		if (StringUtils.isBlank(name) || "dazzle".equals(name)) {
			if (this.protocol == null) {
				protocol =  new DoraProtocol();
			}
		} else {
			// protocol = new 其它协议
		}
		return  protocol;
	}
	
}
